<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
    </head>
    <body>
        <button >开始</button>
        <button >结束</button>
        <h1 id="txt">开始抽奖吧</h1>


        <script>
            var tag=document.getElementById('txt');
            var timer;

            timer=setInterval(function(){
               tag.innerHTML=parseInt(Math.random()*10)
            },1000)
            timer=clearInterval(function(){
                tag.innerHTML=parseInt(Math.random()*10)
            },1000)
        </script>
    </body>
</html>